package pikes.samples.countries;

import java.util.Locale;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;


public class DefaultCountryServiceTestCase {

	private DefaultCountryService countryService = null;
	
	@Before
	public void createCountryService() throws Exception {
		countryService = new DefaultCountryService();
		countryService.afterPropertiesSet();
	}
	
	@Test
	public void allcountries() throws Exception {
		Assert.assertEquals(242, countryService.getAllCountries(Locale.US).size());
		Assert.assertEquals(242, countryService.getAllCountries(Locale.ENGLISH).size());
		Assert.assertEquals(242, countryService.getAllCountries(Locale.FRENCH).size());
	}
	
	@Test
	public void country() throws Exception {
		//System.out.println(countryService.getCountry("US", Locale.GERMAN));
		System.out.println(countryService.getAllCountries(Locale.US));
	}
	
	@Test
	public void isocountries() throws Exception {
		Assert.assertEquals(242, Locale.getISOCountries().length);
	}
}
